<template>
    <el-dialog
      :title="title"
      :close-on-click-modal="false"
      :visible.sync="visible"
      :before-close="cancel"
      class="JNPF-dialog JNPF-dialog_center"
      lock-scroll
      width="40%"
    >
      <el-row :gutter="15" class="">
        <el-form
          ref="elForm"
          :model="dataForm"
          :rules="rules"
          label-width="100px"
        >
          <el-col :span="24">
            <el-form-item label="教职工编号" class="required" prop="FCATNO">
              <el-input
                v-model="dataForm.FCATNO"
                placeholder="请输入"
                clearable
                :disabled="!insertorupdate"
                maxlength="8"
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="24">
            <el-form-item class="required" label="教职工名称" prop="FCATNAME" >
              <el-input
                v-model="dataForm.FCATNAME"
                placeholder="请输入"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="24">
            <el-form-item label="手机号码" >
              <el-input
                v-model="dataForm.FTELNO"
                placeholder="请输入"
                type="number"
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="24">
            <el-form-item label="IC卡号1">
              <el-input
                v-model="dataForm.FCARD1"
                placeholder="请输入IC卡号1"
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="24">
            <el-form-item label="IC卡号2">
              <el-input
                v-model="dataForm.FCARD2"
                placeholder="请输入IC卡号2"
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>

        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button  v-if="insertorupdate" type="primary" v-loading="loading">确 定</el-button>
        <el-button v-else type="primary"  v-loading="loading">修 改</el-button>
      </span>
    </el-dialog>
  </template>
  <script>
  import jnpf from "@/utils/jnpf"
  export default {
    props: {
      parelist: {
        type: Array,
        default: []
      },
    },
    data() {
      return {
          title:"新增",
          dataForm:{
            FCATNO: "H1002",
            FCATNAME: "汉武帝",
            FTELNO: "16790872156",
            FCARD1:"0887831278",
            FCARD2:"",
            FSEX:1,
            FSEQNO: 1,
            FVISIBLE: 1,
            FIMAGE: null,
            FOPERATOR: "system",
            FUPDDATE: "2011-02-16T02:57:02.000+00:00"
          },
          rules: {
          },
        fvisiblelist:[
          {id:"1",fullName:"是"},
          {id:"2",fullName:"否"},
        ],
        loading:false,
        visible:false,
        insertorupdate:true
      };
    },
    created() {
    },
    mounted() {},
    methods: {
      //
      init(id){
        this.dataForm.FCATNO= id || ''
          if(this.dataForm.FCATNO)
          {
              this.title="修改"
             this.insertorupdate=false;
          }
          else
          {
            this.insertorupdate=true;
              this.title="新增";
          }
          this.visible=true;
      },
      //
      cancel(){
          this.$refs.elForm.resetFields();
          this.visible=false;
      },
    },
  };
  </script>
  
  
  
  
  